import Vue from 'vue'
import Router from 'vue-router'
import Home from './views/Home.vue'

Vue.use(Router)

export default new Router({
	routes: [{
			path: '/',
			redirect: "/home"
		},
		{
			path: '/home',
			name: 'home',
			component: Home,
			meta: {
				title: "首页",
				isTopNav: true,
				isBtnNav: true
			}
		},
		{
			path: '/buy',
			name: 'buy',
			component: () => import('./views/Buy.vue'),
			meta: {
				title: "购票",
				isTopNav: true,
				isBtnNav: true
			}
		}, {
			path: "/shop",
			name: 'shop',
			component: () => import("./views/Shop.vue"),
			meta: {
				title: "商城",
				isTopNav: true,
				isBtnNav: true
			}
		},{
			path: '/',
			redirect: {//路由重定向
				name: "find"
			}
		},{
			path: '/find',
			name: 'find',
			component: () => import("./views/Find.vue"),
			meta: {
				title: "发现",
				isTopNav: true,
				isBtnNav: true
			},
			children: [{
				path: '/find/',
				name: 'news',
				component: () => import("./views/find/children/news.vue"),
				meta: {
					title: "新闻",
					isTopNav: true,
					isBtnNav: true
				}
			},{
				path: '/find/trailer',
				name: 'trailer',
				component: () => import("./views/find/children/trailer.vue"),
				meta: {
					title: "预告片",
					isTopNav: true,
					isBtnNav: true
				}
			},{
				path: '/find/ranking',
				name: 'ranking',
				component: () => import("./views/find/children/ranking.vue"),
				meta: {
					title: "排行榜",
					isTopNav: true,
					isBtnNav: true
				}
			},{
				path: '/find/cinecism',
				name: 'cinecism',
				component: () => import("./views/find/children/cinecism.vue"),
				meta: {
					title: "影评",
					isTopNav: true,
					isBtnNav: true
				}
			}]
		}, {
			path: '/login',
			name: 'login',
			component: () => import("./views/Login.vue"),
			meta: {
				title: "登录",
				isTopNav: false,
				isBtnNav: false
			}
		},{
			path: '/movieDetail/:id',
			name: 'movieDetail',
			component: () => import("./views/movieDetail/movieDetail.vue"),
			meta: {
				title: "电影详情",
				isTopNav: false,
				isBtnNav: false
			}
		},{
			path: '/movieNews/:id',
			name: 'movieNews',
			component: () => import("./views/movieNews/movieNews.vue"),
			meta: {
				title: "新闻详情",
				isTopNav: false,
				isBtnNav: false
			}
		}, {
			path: '/404',
			name: '404',
			component: () => import("./views/404.vue"),
			meta: {
				title: "404",
				isTopNav: false,
				isBtnNav: false
			}
		},{
			path: '/address',
			name: 'address',
			component: () => import("./views/Address.vue"),
			meta: {
				title: "城市",
				isTopNav: false,
				isBtnNav: false
			}
		}
	]
})
